#include <OgreKeyEvent.h>
#include "keyboard.h"

using namespace Ogre;
using namespace std;

//************************************************************
// Implementation of Keyboard
//************************************************************
Keyboard::Keyboard() : mEscWasPressed(false)
{
}

void Keyboard::keyClicked(KeyEvent *e)
{
    LogManager::getSingleton().logMessage("keyClicked");
    if (e->getKey() == KC_ESCAPE)
    {
        mEscWasPressed = true;
        e->consume();
    }
}

void Keyboard::keyPressed(KeyEvent *e)
{
}

void Keyboard::keyReleased(KeyEvent *e)
{
}

bool Keyboard::frameEnded(const FrameEvent& evt)
{
   return !mEscWasPressed;
}
